package com.finaInorderProvider.controller;

import com.finaInorderProvider.service.impl.FinaInorderServiceImpl;
import entity.Inorderinfo;
import entity.Outorderinfo;
import entity.ResponseMessage;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import service.financial.FinaInorderService;

import java.util.Map;

/**
 * @author oahner
 * @create 2022-04-22 11:07
 */
@RestController
@CrossOrigin
@RequestMapping("finaInorder")
public class FinaInorderProviderController {

    private Logger logger = Logger.getLogger(getClass());

    @Autowired
    private FinaInorderService service;


    /**
     * 获取采购订单列表
     * @param finaInorderPage
     * @return
     */
    @RequestMapping("getFinaInorder")
    public ResponseMessage getFinaOutorder(@RequestBody Map<String,Object> finaInorderPage){
        logger.info("FinaOutorderConsumerController getFinaOutorder params:finaInorderPage="+finaInorderPage);
        ResponseMessage msg = service.getFinaInorder(finaInorderPage);
        logger.debug("FinaOutorderConsumerController getFinaOutorder result:msg="+msg);
        return msg;
    }

    /**
     * 获取采购订单详情
     * @param finaInorderinfo
     * @return
     */
    @RequestMapping("getFinaInorderInfo")
    public ResponseMessage getFinaOutorderInfo(@RequestBody Inorderinfo finaInorderinfo){
        logger.info("FinaOutorderConsumerController getFinaOutorder params:finaInorderinfo="+finaInorderinfo);
        ResponseMessage msg = service.getFinaInorderInfo(finaInorderinfo);
        logger.debug("FinaOutorderConsumerController getFinaOutorder result:msg="+msg);
        return msg;
    }

}
